# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Ray Rashif <schiv@archlinux.org>
# Contributor:  Ionut Biru <ibiru@archlinux.org>
# Contributor: Hugo Doria <hugo@archlinux.org>

pkgname=lame
pkgver=3.100
pkgrel=4
pkgdesc='A high quality MPEG Audio Layer III (MP3) encoder'
arch=(loong64 x86_64)
url=http://lame.sourceforge.net/
license=(LGPL)
depends=(ncurses)
makedepends=(nasm)
provides=(libmp3lame.so)
options=(debug)
source=(
  https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
  $pkgname.pc.in
)
sha256sums=('ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e'
            '5b746f51caeb202ae4fe3f09fc2db0b38096598d9496945d7fdfdd23c5868e93')
b2sums=('6954d30cfd3951ea07762ba5dd7ff27038b78455f423099a225ebf748abddf9970e444456ca5a6179bd381e2205b32293392cb757c203901674860710fe2c183'
        '1a56722d730f0dff06fe756b089239d28781ec0300cb90fb014d25a7f92d40febff6ba18b621b6cbc4af7babfea90c7382e34787271b1cf2d82d239416837776')

prepare() {
  sed -e "s/VERSION/$pkgver/" $pkgname.pc.in > $pkgname.pc
}

build() {
  cd $pkgname-$pkgver

  ./configure \
    --prefix='/usr' \
    --enable-nasm \
    --enable-mp3rtp \
    --enable-shared
  make
}

check() {
  make test -C $pkgname-$pkgver
}

package() {
  make DESTDIR="$pkgdir" install -C $pkgname-$pkgver
  install -vDm 644 $pkgname.pc -t "$pkgdir/usr/lib/pkgconfig/"
}
# vim: ts=2 sw=2 et:
